<?php
header("Content-Type:text/html;charset=utf-8");
session_start();
include_once("conn.php");

$sql = "select category.cate_name,category.cid from category where name='".$_SESSION["current_user"]."'";
$result = mysql_query($sql);
while($gotShow = mysql_fetch_array($result) )
{

	$cid = $gotShow["cid"];
	echo '<div>';
	echo '<ul>';
	echo $gotShow["cate_name"];

	$sql = "select distinct link.webname,link.webaddress from cate_link,link,category where cate_link.lid=link.lid && cate_link.cid = '".$cid."' && category.cid=cate_link.cid ";
	$result1 = mysql_query($sql);
	while($gotWebName = mysql_fetch_array($result1) )
	{
		echo '<li>';
		echo '<a href='.$gotWebName["webaddress"].'>'.$gotWebName["webname"];
		echo '</a>';
		echo '</li>';
	}
	echo '</ul>';
	echo '</div>';
	echo '<br>';
	
}

echo '<a href="index.php">返回首页</a>';

?>